{% set location = 'account' %}
{% extends 'layout.html' %}
{% block title %}
编辑用户
{% endblock %}
{% from "_page.html" import render_errors %}
{% block content %}
<ul class="breadcrumb">
    <li><a href="{{url_for('account_backend.index')}}">用户列表</a><span class="divider">/</span></li>
    <li class="active">编辑用户</li>
</ul>
    <div class="settings">
    <h3>修改账户信息</h3>
    <form class="form-horizontal" method="POST">
        {{ form.hidden_tag() }}
        {{ form.user_id()}}
        <div class="control-group">
            {{form.username.label(class="control-label")}}
            <div class="controls">
              {{ form.username() }} {{ render_errors(form.username) }}
            </div>
        </div>
        <div class="control-group">
            {{form.email.label(class="control-label")}}
            <div class="controls">
              {{ form.email() }} {{ render_errors(form.email) }}
            </div>
        </div>
        <div class="control-group">
            {{form.role.label(class="control-label")}}
            <div class="controls">
              {{ form.role() }} {{ render_errors(form.role) }}
            </div>
        </div>
        <div class="control-group">
            {{form.active.label(class="control-label")}}
            <div class="controls">
              {{ form.active() }} {{ render_errors(form.active) }}
            </div>
        </div>
        {% if user.code%}
        <div class="control-group">
            <div class="controls">
                <p>{{user.code}}</p>
                <p>{{user.code_datetime}}</p>
            </div>
        </div>
        {% endif %}
        <div class="form-actions">
            {{form.submit(class="btn btn-primary")}}
            {% if user.code %}
           <a class="btn" href="{{url_for('account_backend.account_active_mail',id=form.user_id.data)}}">
                发送激活邮件
            </a>
            {% endif %}
        </div>
    </form>
    </div>
{% endblock %}